package com.supreme.threadserver.threadpkg;

public class WaitThread implements Runnable {

    private final long timeout;

    public WaitThread(long timeout) {
        this.timeout = timeout;
    }

    @Override
    synchronized public void run() {
        final String threadName = Thread.currentThread().getName();
        try {
            System.out.println("threadName = " + threadName + " Start");
            this.wait(this.timeout);
            System.out.println("threadName = " + threadName + " Finish");
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}
